package com.goktech.dao.impl;

import com.goktech.dao.Userdao;
import com.goktech.entity.User;
import com.goktech.utils.GOKJDBCUtil;

import java.util.List;

public class Userdaoimpl implements Userdao {
    @Override
    public void register(String username, String password, String flag, String score) {
        String sql = "INSERT INTO users(users, passwords, flag, score) VALUES(?,?,?,?)";
        System.out.println(11111);
        int update = GOKJDBCUtil.update(sql, username, password, flag, score);
    }

    @Override
    public boolean login(String username, String password) {
        String sql="select * from users where users =? and passwords=?";
        List<User> user = GOKJDBCUtil.query(sql, User.class, username, password);

        if (user.size() != 0) {
            return true;
        }
        return false;
    }
}
